<template>
  <div class="container">
    <div style="text-align: center">
      <p>
        <logo />
      </p>
      <h1>{{ detail.desc }}</h1>
    </div>
  </div>
</template>

<script>
import Logo from '~/components/Logo.vue'
export default {
  components: {
    Logo
  },
  // 正确姿势=>服务器调用，处理模版和数据的渲染
  async asyncData ({ $axios }) {
    const res = await $axios.$get('/meng/collect')
    return { detail: res }
  },
  // 错误=》客户端js处理模版和数据的渲染
  async created () {
    const res = await this.$axios.$get('/meng/collect')
    this.detail = res
  }
}
</script>

<style>
</style>
